package com.choosefine.it.basedata.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.choosefine.it.basedata.model.User;
import com.choosefine.it.basedata.model.dto.FindUserDTO;
import com.choosefine.it.basedata.model.dto.UserSearchDTO;
import com.choosefine.it.basedata.model.vo.UserSearchVO;
import com.choosefine.it.basedata.model.vo.UserVO;
import com.github.pagehelper.Page;

/**
 * 用户相关映射
 * 
 * @author guwenwei
 *         2016/11/15
 */
public interface UserMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(User record);

	User selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(User record);

	UserSearchVO findByUserCode(@Param(value = "userCode") String userCode, @Param(value = "type") Integer type);

	int deleteByUserCode(Map<String, Object> map);

	int deleteByUUID(Map<String, Object> map);

	List<User> selectAll();

	Page<User> getUserList();

	List<UserSearchVO> selectUserBy(UserSearchDTO object);

	int deleteById(Map<String, Object> map);

	User findByUuidAndRole(@Param(value = "uuid") String uuid, @Param(value = "userRole") Integer userRole);

	int updateByPhone(@Param(value = "oldPhone") String oldPhone, @Param(value = "newPhone") String newPhone);

	int deleteByPhone(@Param(value = "phone") String phone, @Param(value = "type") Integer type);

	int deleteByIds(Map<String, Object> map);

	List<UserVO> selectUser(FindUserDTO object);

	User findByUserName(String userName);

}
